<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	List<TblCheckData> list = (List<TblCheckData>)request.getAttribute("list");
	CheckDataForm form = (CheckDataForm)request.getAttribute("command");
%>
<div class="main">
	<div class="oaTable">
	<div class="toolPannel">
		<div class="box">
					<div>
						开始日期：
						<input style="width: 100px;" type="text" value="<%=form.getStartdate() %>" name="startdate" onClick="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd'})">
					</div>		
					<div>
						结束日期：
						<input style="width: 100px;" type="text" value="<%=form.getEnddate() %>" name="enddate" onClick="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd'})">
					</div>
					<div>考勤机：
						<select id="deviceList" class="easyui-combobox" name="deviceid" style="width:100px;"></select>
					</div>					
		</div>
		<div class="box">
					<div>所属公司：
						<select id="siteList" class="easyui-combobox" name="siteid" style="width:100px;"></select>
					</div>		
					<div>部门：
						<select id="deptList" class="easyui-combobox" name="deptid" style="width:100px;"></select>
					</div>					
					<div>工号：
						<input id="userid" type="text" name="userid" class="search" value="<%=StringUtils.isNotBlank(form.getUserid())?form.getUserid():""%>"
							placeholder="请输入员工编号"/>
						<input type="button" class="searchSubmit" onclick="javascript:XF.Check.dataSummaryListSearch()" value="搜索"/>
					</div>
		</div>
	</div>
	
<table class="tableList">

	<tbody>
		<tr id="tableHeader">
			<th style="width: 14%">工号</th>
			<th style="width: 10%">姓名</th>
			<th style="width: 10%">部门</th>
			<th style="width: 14%">所属公司</th>
			<th style="width: 15%">打卡天数</th>
			<th style="width: 8%">打卡次数</th>
			<th style="width: 8%">打卡明细</th>
		</tr>
		<%
			if (list != null && list.size() > 0) {
				for (TblCheckData data: list) {
					String id = EncrypTool.encode(data.getId()+"");
		%>
						<tr>
							<td><%=data.getUserid() %></td>
							<td><%=data.getUsername()!=null?data.getUsername():"" %></td>
							<td><%=data.getDeptname()%></td>
							<td><%=data.getSitename() %></td>
							<td><%=data.getDays() %></td>
							<td><%=data.getChecks() %></td>
							<td><a style="color:#ff5a00" href="javascript:XF.Check.userDetail('<%=data.getUserid()%>')">查看明细</a></td>
						</tr>
					<%
				}
			}
		
		%>
		        
        		<tr id="tableFooter">
			<td colspan="7">
				<div class="pagination">
					<monggoTag:pagination href="datasummary_search"
						pageSize="<%=form.getPageSize()%>"
						totalRecord="<%=form.getTotalRecord() %>"
						currentPage="<%=form.getPageNum() %>">
					</monggoTag:pagination>
				</div>
			</td>
		</tr>
	</tbody>
</table>
</div>
</div>
<div id="userdetail_popwin" closed="true" class="easyui-window" title="打卡明细" style="width:900px;height:600px;"></div>
<script>
$('#siteList').combobox({
	url:global.contextPath + '/company/siteList',
	valueField:'siteid',
	textField:'sitename',
	panelHeight: '300'
});
$('#deptList').combobox({
	url:global.contextPath + '/company/deptList',
	valueField:'dictid',
	textField:'dictname',
	panelHeight: '300'
});
$('#deviceList').combobox({
	url:global.contextPath + '/check/devices',
	valueField:'sn',
	textField:'name',
	panelHeight: '300'
});
$('#siteList').combobox('setValue', '<%=form.getSiteid() %>');
$('#deptList').combobox('setValue', '<%=form.getDeptid() %>');
$('#deviceList').combobox('setValue', '<%=form.getDeviceid() %>');
$("#userdetail_popwin").window();
</script>